What Can Grokking Teach Us About Learning Under Nonstationarity?