There are a few ways.
1. Ride reports from aircraft ahead. ATC can forward the info to you as well.
2. Doppler radar can pick up horizontal shifts in rain = turbulence. (Not all aircraft have that capability. X band wx radar)
3. Conventional radar with amber or red returns. Good chance it'll be bumpy.
4. Preflight. Note the significant weather chart and the turbulence areas. Flight plan will have predicted turbulence on it (Ours do).
5. Wake turbulence. Often you can see the vortices.
If it was a few seconds, I'd go with a wake vortex or it was a smallish Cu cloud they couldn't get a vector around.