Stochastic averaging, large deviations and random transitions for the dynamics of 2D and geostrophic turbulent vortices