Sonic becomes King Sonic in Sonic and the Black Knight. The transformation happens during the battle against the Dark Queen, complete with a cutscene showing Sonic changing into his King form.
One clarification: it's tied to how you fight her rather than simply the aftermath. You transform into King Sonic during that confrontation, and after the battle you can remain in that form, unless you replay the boss fight.