The macro system doesn't support this. Icons for skills that upgrade will update automatically, but skills that are entirely separate cannot change without a hotbar swap, and such a swap would render the purpose of the swap moot because your button would just alternate between Royal Authority and Atonement as you spammed it, without accounting for the three charges.
I don't recommend the use of macros for this, but if you're really set on it, use the Atonement icon instead of Royal Authority. It'll darken when you have no Sword Oath stacks, which will give you more information than the Royal Authority button which will always be lit.