Mastery is of a specific spell by default. Mastering a spell will not have any effect on another Similar spell. This is fairly definite in the Rules (unless I'm missing something).
Adaptive Casting makes things a little more complicated. It allows you to apply the mastery abilities and level you've learnt for one "General" spell to the same spell at a different level. What counts as a "General" spell I've seen debated (Adaptative casting):
- Spells that are off a "General" base level such as most wards are clearly included.
- It's less clear whether spells that give an increasing scale of damage, but are otherwise identical, are included. Technically, Pilum of Fire and Ball of Abysmal Flame are pretty much the same spell, just with a higher base. However, they're not off a "general" guideline. On the otherhand, there is a CrAq General guideline to do +level damage.