how to put physics formulae/laws together and make transformer?
Input to output voltage ratio is the same as the primary-secondary turns ratio. 

For 42 see this. 

So, if you want 220V out for 12V in the turns ratio is 18.3333.

Next you want to know how many turns for the primary (12V) winding and this is more complex. When driving the primary with a 12V RMS sine wave you don't want to be taking loads of current (unloaded output) because the core will saturate. This means you need to have a certain minimum inductance for the primary.

Most 230V AC transformers are in the realm of 1 henry inductance. For a 12V input running at 100mH for 50Hz will be about in the right range.

If you know what core size and laminations you want, the manufacturer of the core will likely give you a figure for a parameter called \$A_L\$. This is the microhenries inductance per turn squared and if you have two turns clearly the winding inductance quadruples.

Let's say they give a figure of 10uH and you need 100mH for the whole winding. This means that 100 turns will do the job because 10uH x 100 x 100 = 100mH. With 12V RMS at 50Hz the current is about 380mA. You'll need to double check to see if this current through 100 turns saturates the core.

Core saturation is due to flux density and all you know is RMS current and turns. Peak current is going to be about 540mA and therefore peak magneto motive force is this figure x turns = 54 ampere-turns. Divide this by the mean length that the magnetic field takes around the core.

Maybe this length is 500mm so, H (magnetic field strength measured in amp-turns per metre) is 108. Then use the BH curve of the core material to see what flux density is. Check to see that it is not high enough to cause too much saturation and you are in business.