Skeet Trap is good training for it. Machine gunners used to train that way to lead targets.
Skeet shoots clays that come towards you at an angle
Ah - you know your history!
In the 8th Air Force during WWII, machine gunners on the B-17’s were specifically trained using trap and skeet techniques, most importantly the critical skill of leading the target, as you so correctly note.
You can imagine - when everything around you is moving hundreds of miles per hour, all points of aim must be where the target isn’t (yet).
It was not initially so, but came about after carefully analyzing (via the fledgling field of Operations Research) their high initial failure rate.
The history of the 8th Air Force and the role it played in defeating Germany is super interesting.
Oddly, when you look at videos of soldiers in the current conflict being attacked by drones, it’s very analogous to a B-17 being set upon by Messerschmitt’s: Same type of problem requiring the same defensive techniques - but not with rifles - need semiautomatic shotguns.