The answer to this is just as [my answer](https://mathoverflow.net/a/378141) to your question https://mathoverflow.net/questions/377981/classification-of-not-necessarily-connected-compact-lie-groups: regard $\operatorname{Aut}(G)$ as an extension of $\operatorname{Inn}(G) = G/\operatorname Z(G)$ by a discrete group $\operatorname{Out}(G)$, and lift $\operatorname{Out}(G)$ to $\operatorname{Aut}(G)$ as the automorphisms that preserve a pinning in the sense of [that answer](https://mathoverflow.net/a/378141). (These are often called "diagram automorphisms".) Over in that other question we did not get an honest section of the component group inside the Lie group because you did not assume that the identity component was centreless, but since the adjoint group $\operatorname{Inn}(G)$ is centreless, everything is fine here.