As far as I know, there's no mention of Memory Modification charms being taught at Hogwarts in class. Or any other non-school-level magic.
Also, as was established on SFF before, there's no university level education in wizarding world, aside from specialized trade training like Auror one.
So, how do people learn more advanced magic like Memory Modification charms (e.g. Lockhart who presumably did NOT go to Auror school), Occulumency or Legilemency?
I am looking for canon/JKR answer.