Puberty as a life history transition