The demographic transition and human capital