Complex landscape topography can facilitate local adaptation during a range shift