This guide will tell you how to Learn Curses you Missed in Hogwarts Legacy.
You will have some relationship side quests during the story, and one of the relationship side quests is following the story of Sebastian. He goes a bit more on the dark side during this quest and he can offer to teach you the spell during those moments.

There is a choice for you to say no or yes. If you’ve said no to any of the curses that you’ve been going through in his story, then you need to wait until post-game. So you must complete his entire story arc and then go to the undercroft. After that, speak to Sebastian and he will teach you any of the curses you have missed.