Local Mechanisms of Compositional Generalization in Conditional Diffusion