Layer-wise Representation Fusion for Compositional Generalization