When four-time Emmy nominee Sharon Horgan set out to write her latest show, HBO’s Youth, she found herself fixating on a visit to the Hay Literary Festival.