It's not an attack style (I think it used to be though). Just go to the spellbook tab and there should be a little shield button somewhere that you can toggle.
Go to the spellbook. If you see a selected one with shield to the close right then that one gives defense experience. Unselect and choose the magic one only so you get only magic xp.