Spatial connectivity increases ecosystem resilience towards an ongoing regime shift