We use TNG and EAGLE hydrodynamic simulations to investigate the central galaxy - dark matter halo relations that are needed for a halo-based empirical model of star formation in galaxies. Using a linear dimension reduction algorithm and a model ensemble method, we find that for both star-forming and quenched galaxies, the star formation history (SFH) is tightly related to the halo mass assembly history (MAH). The quenching of a low-mass galaxy is mainly due to the infall-ejection process related to a nearby massive halo, while the quenching of a high-mass galaxy is closely related to the formation of a massive progenitor in its host halo. The classification of star-forming and quenched populations based solely on halo properties contains contamination produced by sample imbalance and overlapping distributions of the two populations. Guided by the results from hydrodynamic simulations, we build an empirical model to predict the SFH of central galaxies based on the MAH of their host halos, and we model the star-forming and quenched populations separately. Our model is based on the idea of adopting star formation templates from hydrodynamic simulations to reduce model complexity. We use various tests to demonstrate that the model can recover star formation histories of individual galaxies, and can statistically reproduce the galaxy bimodal distribution, stellar mass - halo mass and star formation rate - halo mass relations from low to high redshift, and assembly bias. Our study provides a framework of using hydrodynamic simulations to discover, and to motivate the use of, key ingredients to model galaxy formation using halo properties.