  We consider a type I or type X two Higgs doublets model with a modified
lepton sector. The generalized lepton sector is also flavor conserving but with
the new Yukawa couplings completely decoupled from lepton mass proportionality.
The model is one loop stable under renormalization group evolution and it
allows to reproduce the $g-2$ muon anomaly together with the different
scenarios one can consider for the electron $g-2$ anomaly, related to the
Cesium and/or to the Rubidium recoil measurements of the fine structure
constant. Thorough parameter space analyses are performed to constrain all the
model parameters in the different scenarios, either including or not including
the recent CDF measurement of the W boson mass. For light new scalars with
masses in the $0.2$-$1.0$ TeV range, the muon anomaly receives dominant one
loop contributions; it is for heavy new scalars with masses above $1.2$ TeV
that two loop Barr-Zee diagrams are needed. The electron $g-2$ anomaly, if any,
must always be obtained with the two loop contributions. The final allowed
regions are quite sensitive to the assumptions about perturbativity of Yukawa
couplings, which influence unexpected observables like the allowed scalar mass
ranges. On that respect, intermediate scalar masses, highly constrained by
direct LHC searches, are allowed provided that the new lepton Yukawa couplings
are fully scrutinized, including values up to 250 GeV. In the framework of a
complete model, fully numerically analysed, we show the implications of the
recent $M_{W}$ measurement.
