Literally by playing the game. As RPGs go, there is very little that is not rewarded with XP. You get XP for winning fights, avoiding fights through dialogue, doing quests, discovering new areas, getting inspiration and probably more.