Ed Miliband says his time at the top of Labour was “traumatic” and defeat in 2015 knocked his confidence.