UK prime minister’s top official will leave next month as government prepares for crucial autumn Budget