Slaughter and May has been involved in its third lucrative government contract in four months, as Britain prepares to leave the EU.