If you take the feat Spell Mastery while you have your Int boosted somehow (such as a Headband of Intellect), do you get to select spells based on your boosted Int?

What if you take Spell Mastery while under a spell like Fox’s Cunning? Would you get to pick spells for that boost?