A general mathematical framework to model generation structure in a population of asynchronously dividing cells