King Charles hands over military role to William