If you have 'fret position dots' set the intonation so your 'natural' finger position is in tune at the octave 9I can't say "12th fret") and magically that finger position will work along the whole length of the neck.
As you move up a position mean you have to adapt constantly so there isn't one simple 'muscle memory' to build.
I found that my fingers naturally come closer together as I move up a result of playing fretted bass anyway. What is trickiest is keeping positions consistent across the strings.
The ultimate arbiter is sound, the dots guide to then changing position, then you will eventually start to subconsciously adjust if out of tune, in the same way you probably bend a string slightly if it sounds flat when playing a fretted bass. You don't learn this, you just discover you are doing it one day, and feel smug 🙂