When photography a moving object, you need to decide whether you want to freeze the action or show movement.
In this first photograph of a moving train, I was in Aperture Priority at f11, the camera choose a shutter speed of 1/320 which froze the train.
In this second photograph, as the train was passing by, I decided to try a panning shot. The idea of this technique is to get a sharp subject and a blurred background. I changed to Shutter Priority mode and selected 1/13 of a second, the camera chose an aperture of f29. I focused on the last car of the train, clicked the shutter and followed the movement of the train with my upper body.
Ideally the train would have a sharper focus and a more interesting background but it illustrates the concept. I just need to practice some more 😉
More more information on the technique of panning, check out this link from Digital Photography School