Flow structure transition mechanisms in thermal convection of air in rectangular containers