To keep it simple, there is no good way to memorize the prime numbers. There is no formula or anything like that. So, depending upon how many prime numbers you need to memorize, one way that may work is using a song. For instance, for the quadratic formula, check this link out:
Many times in math, there are examples like this. I have heard of students making the quadratic formula into a rap song. So, for example, take one of your favorite songs, probably the melody/music and not so much the words, then make the words the prime numbers:
1, 2, 3, 5, 7, 11, 14, 17, 23, 29, . . .
Past that, you are talking about simply memorizing them, like memorizing how to spell words or definitions of words, etc.
Good luck, user8731. I hope this helps.