Resignation will trigger first by-election of Keir Starmer’s government