For example, a Walking Wake that had a higher stat of Speed than SpA before Specs, but then has a higher SpA after Specs. Would Protosynthesis boost SpA or Speed in that situation?
When a Pokémon with Protosynthesis/Quark Drive is in harsh sunlight or is holding Booster Energy, its highest stat (other than HP and taking into account stat stages, but not held items) is increased by 30%, or 50% if Speed is the highest stat.
Protosynthesis (Bulbapedia) Quark Drive (Bulbapedia)