The 1st transformer circuit is not an inverting one. The output phase is in sync with the input.
The 2nd transformer circuit as you see is wired somewhat differently. The upper end is grounded (in reverse to the input). That causes the electrons in the secondary to flow in opposite direction to the primary. That effectively gives you a 180dgs phase shift.
The 3rd example shows you the transistor's inverting properties between base and collector, which gives you the final phase shift you need to create a complete 360dgs positive feedback.