@kdc
A caveat before I share my limited knowledge - I am not a bike mechanic. I have learned a few things along the way of commuting by bike for many years. What is below is correct to the best of my knowledge from my experience.
The most common cause for a loose fork would be headset adjustment by a long ways. A distant second would be a worn out headset, then other causes.
Think of the head tube as a pipe, the headsets as cones with the points pointing into the pipe. The fork is attached to the flat end of one of cone #1, the handlebar riser/stem/handlebar sits on the flat end of cone #2. Gravity loosely holds the pipe against cone #1/fork. Cone #2/handlebar needs to be held tight against the pipe/head tube otherwise, if there is a gap then the handlebars can wiggle, and when they wiggle the fork pivots on the place where cone #1 and pipe touch.
It might be worth checking other things that could feel like the fork moving and/or often can be tricky diagnosis:
-quick release is tight - Don't need to be a hero but it should not be able to be opened by one finger of a five-year-old.
-wheel bearings tight - grab fork in one hand and top of wheel in the other hand and pull it back and forth, left and right with respect to sitting on the bike ie. perpendicular to the way the wheel turns
-brake play is not what you are feeling - grab the front brake strongly - mine when I pull the brake not very hard has a little slop in the mechanism (BB5 cable disc brake) which I at first thought was headset
-spokes sometimes make all kinds of noises. If you rub your fingernail across the spokes or pluck them like a guitar or harp then all the spokes should twang a note - not sound a dull thunk nor a really, really high pitched ping. Even with proper tension they often make all kinds of noises and I am not good enough to advise beyond recognizing some of the common issues to take to a mechanic.
-play in the rear suspension can feel like headset slop when you are on the bike - another thing I discovered by experience - The spring tension was so low that there was a lot of slop
-cables can rub on each other and wiggle in the end of the brake lever/ giving all kinds of weird feel through the handlebar if you are hyper sensitive like me.
Anyway there are some things to check out.
Hope that helps. You might have to do my solution several times before all play is removed from all of the many pieces that make up the headset as they settle into place following a ride. It can be really awkward adjusting things.
Cruz-on!