Mastery Clarification

Hi all new to the forum. We just started playing 5e. Played it years ago in an earlier version. In regards to spell mastery I couldn't grasp how we are to apply levels to it. Are the levels in it purchased as ability levels ie; if I take "mastered spells" virtue I spend 30 pts on level 3 mastery?

Yes. Unless you have Flawless Magic in which case all xp put into spell mastery count double in terms of determining level... on top of receiving the firsts level of mastery for free.

And yes, Mastery advance as Abilities.