Emergence in non-neural models: grokking modular arithmetic via average gradient outer product