A Theory of Emergent In-Context Learning as Implicit Structure Induction