Model Stitching by Functional Latent Alignment