A Theory of Learning with Autoregressive Chain of Thought