The technique to achieve this is called panning.
If the vehicle is moving, you move the camera with the vehicle. It will require some skill to do this perfectly, such that the vehicle itself is sharp. The slower the shutter speed, the more extreme the effect, but also, the more difficult it becomes to keep the vehicle sharp. As a guideline you can start between 1/100 and 1/200.
But also the focal length is relevant in determining your shutter speed. When you are very close to the vehicle, and have a shorter focal length, you will have to make a bigger movement in order to track the vehicle in the same amount of time.
So, set your shutter speed and practice, practice, practice!
An example by myself:
A failed attempt, you can see that the vehicle is unsharp as well: