An analytical approach is proposed to study the evolution of the star-forming galaxy (SFG) main sequence (MS) and the fraction of dust-obscured SF up to $zsim4$. Far-ultraviolet (FUV) and infrared (IR) star formation rates, SFRs, are described as conditional probability functions of $M_{ast}$. We convolve them with the galaxy stellar mass function (GSMF) of SFGs to derive the FUV and IR LFs. The 2 SF modes formalism is used to describe starburst galaxies. By fitting observed FUV and IR LFs, the parametrization of SFR$_{rm FUV}-M_{ast}$ and SFR$_{rm IR}-M_{ast}$ are constrained. Our derived SFR$_{rm FUV+IR}-M_{ast}$ reproduces the evolution of the MS as compared to other observational inferences. At any redshift, we find that the sSFR$_{rm FUV+IR}-M_{ast}$ relation for MS SFGs approaches to a power law at the high-mass end. At lower masses, it bends and eventually the slope sign changes from negative to positive at very low masses. At $zsim0$, this change of sign is at $M_{ast}sim5times10^{8}{rm M}_{odot}$ close to dust-obscured SF regime, $M_{ast}sim6times10^{8}{rm M}_{odot}$. The slope sign change is related to the knee of the FUV LF. Our derived dust-obscured fractions agree with previous determinations at $0leq zleq2.5$. Dust-obscured fractions depend strongly on mass with almost no dependence with redshift at $zgtrsim1.2$. At $zlesssim0.75$ high-mass galaxies become more transparent compared to their high redshift counterparts. On the opposite, low- and intermediate-mass galaxies have become more obscured by dust. The joint evolution of the GSMF and the FUV and IR LFs is a promising approach to study mass growth and dust formation/destruction mechanisms.