From Malthusian to modern fertility: when intergenerational transfers matter