The former Conservative justice secretary will stand as an independent to oppose a “hard Brexit”.