Do it enough and you reprogram the nervous system.
A similar change happened in college and graduate school: my science education (see username) required distinguishing a lot of characters most people don't need to distinguish often, like 'ω' and 'w' and 'v', or 'x' and 'X' and 'χ', and between '2' and five different forms of 'z'/'Z' (that one happened during statistical mechanics class...). With just a little bit of conscious effort, I could permanently change how I wrote letters. I didn't even need to explicitly practice: the natural use during note-taking and homework assignments form was plenty sufficient, at least for me.
Your nervous system really can reprogram itself!
A couple semi-related tips for anyone who wants better handwriting:
1. Just go slower. Your handwriting is probably perfectly legible to others if you allow yourself the time to do so.
2. Realize when it does and doesn't matter. A doctor writing a critical prescription by hand (not that they do that these days) is very different from scribbling on a sheet of scratch paper that you'll throw out as soon as you've figured out what you're doing.
3. Try a fountain pen or felt-tip marker. These require zero pressure to write, just contact. That makes things take a lot less effort, so your muscles can work on shaping the letters instead of pushing a pen. Rollerball pens aren't half bad, but fountain pens are still the gold standard for a reason.
If you don’t want a cursive script then you could also look into the faces found in old Speedball lettering manuals.
/r/fountainpens is a really nice community with lots of guides to troubleshooting pens, as well as recommendations for beginners. If anyone's curious reading this, the Platinum Preppy is a very good, very inexpensive fountain pen that gets recommended a lot.
Now I can't really write cursive even if I want to. My signature, which is in cursive, has morphed to an unintelligible mess over time.
[1] - https://www.nala.ie/sites/default/files/publications/better_...
The first few weeks were horrible though: new style not yet ingrained in the brain, old style already being forgotten.