Optimal Intergenerational Redistribution in a Two-Country Model with Endogenous Fertility