Red Bull head of race strategy Will Courtenay will leave the team after 14 years in the role to join McLaren as sporting director.