How do we check the images are 28 x28?

You should be able to do this by printing .shape on the input tensor without any transformation (e.g., transform=transforms.Compose( [transforms.ToTensor(),]).

How did you decide the scale values to be 0.675 to 1?

This was a guess based on your description of cropping 5 pixels e.g., 23x23/28x28 is approximately 0.675, but this is ultimately a tunable hyperparameter and you can adjust this (e.g., based on validation accuracy).