Overcoming Shortcut Learning in a Target Domain by Generalizing Basic Visual Factors from a Source Domain