population_transitions function

Nested functions for stage-based population transitions.