Ecological constraints for intergenerational transmission of attachment