SEMPER: I. A novel semi-empirical model for the radio emission of star-forming galaxies at 0 < z < 5