Regimes of low-frequency variability in a three-layer quasi-geostrophic ocean model