Good hazard perception is a way of looking, not a sixth sense. You can train your eyes to spot trouble early.
Lift your eyes up the road rather than fixing on the car in front. Scan the distance for developing situations, then bring your eyes back to what is close, and keep cycling between the two.
Parked cars can hide pedestrians, a bus at a stop may pull out, and a ball bouncing into the road often means a child is following. Reading these clues early gives you time to slow down before anything becomes urgent.