Honestly, some of it is just practice until you have memorized the notes by playing pieces. You can also use cue cards. When you have seen 99 times that the note on the first/bottom line of the G clef staff is the E right above middle C, chances are that the hundredth time you'll have started to remember that it's the E right above middle C.I have even read an article critiquing 'Every Good Boy Does Fine' and 'FACE' because it adds extra steps to recognizing the note, i e 1. See the note2. Remember 'Every Good Boy Does Fine' or FACE3. Remember where on the staff the mnemonic starts and which direction you go (ie top and down or bottom and up)4. Count to identify which word/letter in the mnemonic the line or space in the staff corresponds to5. Identify the letter6. Translate the letter into a piano keyYou probably shouldn't get into the habit of doing this as your crutch. When memorizing the notes directly, the process might be more like:1. See the note2a. Either recognize which letter it corresponds to because you have memorized it or2b. Look it up on a cue card or chart or similar to refresh your memory3. Translate the letter into a piano keyThank you anacrusis!
I agree with anacrusis. Sometimes you just have to practice until it starts becoming automatic. It's just like learning to read when in school. When you start it's really slow, but now you don't even have to think about it because you have read so much at this point. Reading piano is a bit more difficult since you need to translate it to a hand position and finger movement, but I think the overall principle is the same.