Direct and adjoint global stability analysis of turbulent transonic flows over a NACA 0012 airfoil