My understanding: Polymorph you don't retain abilities from before, i.e. spell casting. But you do gain the new abilities of the new form.
Now their is a really good point upthread, that you gain the form, i.e. stone giant, but not the unique abilities of Archmage King Karl of the stone giants. Now, is archmage a special instance of human/elf/etc or are they generic enough you can TP into an archmage?
In comparison, shapechange says "You transform into an average example of that creature, one without any class levels or the Spellcasting trait." But TP doesn't say that, so...?