The transition from geostrophic to stratified turbulence