A collection of diaries has won the prestigious Baillie Gifford Prize for Non-Fiction for the first time.