  In the early Universe above the weak scale, both baryon $B$ and lepton $L$
numbers are violated by nonperturabive effects in the Standard Model while
$B-L$ remains conserved. Introducing new physics which violates perturbatively
$L$ and/or $B$, one can generate dynamically a nonzero $B-L$ charge and hence a
nonzero $B$ charge. In this work, we focus on the former scenario which is also
known as leptogenesis. We show how to describe the evolutions of lepton flavor
charges taking into account the complete Standard Model lepton flavor and
spectator effects in a unified and lepton flavor basis-independent way. The
recipe we develop can be applied to any leptogenesis model with arbitrary
number of new scalars carrying nonzero hypercharges and is valid for cosmic
temperature ranging from $10^{15}$ GeV down to the weak scale. We demonstrate
that in order to describe the physics in a basis-independent manner and to
include lepton flavor effect consistently it is necessary to describe both
left-handed and right-handed lepton charges in terms of density matrices. This
is a crucial point since physics should be basis independent. As examples, we
apply the formalism to type-I and type-II leptogenesis models where in the
latter case, a flavor-covariant formalism is indispensable.
