The Department for Exiting the European Union (DExEU) spent £3.7m on legal costs during the last financial year, including more than £1.2m on Brexit-related litigation, its accounts have revealed.