Election partly turned on fear of Trump, a similar playbook Starmer hopes to use against rightwing challengers