No study is required
If you polymorph into another race and that race is capable of spellcasting, then you are also capable of spellcasting. From the Transmutation (Polymorph) spell school rules:
While in such a form, you cannot cast any spells that require material components (unless you have the Eschew Materials or Natural Spell feat), and can only cast spells with somatic or verbal components if the form you choose has the capability to make such movements or speak, such as a dragon.
On the example, a dragon can speak and provide somatic components for spells, so changing into a dragon will allow you to cast spells normally.
Note that Somatic components, in general, require a hand:
A somatic component is a measured and precise movement of the hand. You must have at least one hand free to provide a somatic component.
That is not true for every creature, as they can provide somatic components with other parts of their bodies if they lack hands. At least, that is the intent of the designers. The Magic rules were written considering the characters are all humanoid, which usually have two hands. But when taking monsters into consideration, some rules will be different and exceptions will show up.
For humanoids, somatic components include hand gestures. For things with other shaped bodies, somatic components include whatever gestures their body naturally makes, be that paw or leg movements, tail wagging, squirming bodies, or whatever.
That said, the spellcasting technique cannot be learned from one creature to another, because the members required will be different from your form. How would you cast spells using your tentacles if your form does not have tentacles?
But whenever you are polymorphing into another creature, you innately can use all your spells if that creature type is known for being able to cast spells. If the creature normally cannot cast spells (like animals), then you might need the Natural Spell and/or Wild Speech feats, which is (as far as I know) exclusive to druid characters. Otherwise, it's impossible to cast spells on this new form, as described under the Transmutation (Polymorph) rules.