There are many layers how to memorize music pieces. The video from Jazer Lee is a good start. But it goes beyond that.
- Muscle memory
Every hand position or finger position as a sequence.
- Aural layer
Everything that goes into your ear like a catchy melody.
- Visual layer
Mainly sheet music.
- Semantics & Theory
Here comes the functional theory into play.
- Pattern Recognition
Typical and unique features of the song and how it is performed like syncopations etc.
- Overall song structure
Dynamics and structure in general.
- Emotional hints
Your feelings and thoughts about the piece. Could be also a place where you’ve performed the piece once.
It is important to use a wide variety of those layers to consolidate the song you are learning. Also you have to repeat your repertoire from time to time to keep it fresh.