The answer depends on what you mean by getting loose". Is the locknut not staying tight, so it backs off and you can turn it by hand? Or does it develop bearing play so the fork is loose and has the characteristic click when you apply the front brake?
The first case might indicate worn or stripped threads at the stop of the fork, or lack of keyed washer keeping the turning forces from the top bearing cup being passed upward.
The second might be as simple as a fork that's a bit long, so the lock nut is bottoming on the end, and not against the adjustable cup. Easily fixed with an added spacer.
__________________
FB
Chain-L site
An ounce of diagnosis is worth a pound of cure.
Just because I'm tired of arguing, doesn't mean you're right.
“One accurate measurement is worth a thousand expert opinions” - Adm Grace Murray Hopper - USN
WARNING, I'm from New York. Thin skinned people should maintain safe distance.