We develop a model to establish the interconnection between galaxies and their dark matter halos. We use Principal Component Analysis (PCA) to reduce the dimensionality of both the mass assembly histories of halos/subhalos and the star formation histories of galaxies, and Gradient Boosted Decision Trees (GBDT) to transform halo/subhalo properties into galaxy properties. We use two sets of hydrodynamic simulations to motivate our model architecture and to train the transformation. We then apply the two sets of trained models to dark matter only (DMO) simulations to show that the transformation is reliable and statistically accurate. The model trained by a high-resolution hydrodynamic simulation, or by a set of such simulations implementing the same physics of galaxy formation, can thus be applied to large DMO simulations to make mock copies of the hydrodynamic simulation. The model is both flexible and interpretable, which paves the way for future applications in which we will constrain the model using observations at different redshifts simultaneously and explore how galaxies form and evolve in dark matter halos empirically.