The trade-off between fertility and education: evidence from before the demographic transition