Intergenerational transmission and the effects of health on migration