To earn the Master of Magic Achievement you need to unlock the Sense of Magic ability. It’s the penultimate ability on the Magic Skill Tree. You need 7 talent points to unlock it.
Note: If you don't want to invest in this skill, make sure you save before you spend the talent points. Then you can go back to your save with the talent points intact.
Note: You cannot earn this while playing the arena mode.
Note: You can get the Swordmaster, Mutant, Master Alchemist, and Master of Magic achievements in one go, by using the From a Bygone Era side mission on Iorveth's path in the correct manner. Follow the walkthrough here.