You learn different spells at specific point in the game in regular story mode. You have to keep playing through all the different episodes for each year in sequence. This means that, sometimes, you'll need to go back to an earlier episode (Free Play) after you've learnt a particular spell in story mode in order to get everything.