Ecological mechanism of climate-mediated selection in a rapidly evolving invasive species