Writing the KVL equations for ideal and non-ideal transformer
The easiest: An ideal transformer shows R3 and L4 to the other side as a resistor and an iductor in series, but you must multiply the resistance and the inductance by the square of the winding ratio. You have effectively only one current loop to calculate. The current I2 is I1/the winding ratio.

If there exists a source on the both sides, you must replace in your equations the mutual inductance voltage terms by an unknown voltages Va and Vb. You get more equations by stating the ideality Va/Vb=Na/Nb and Ia/Ib=Nb/Na. Ia means your I1 and Ib means your I2.