Sir James Mackintosh, 1774-1783