Demographic transition and education in developing countries