If runs VNC / ScreenShare / Remote Desktop to your Mac, there appears to be no way to know that has happened.
This option exists:
but it does not appear to do anything. I can't actually even find the menu extra that is supposed to be enabled when you turn this on.
From my limited testing, it appears that both Screen Sharing and Remote Desktop (and I assume generic VNC), all seem to trigger this process to run:
Other than running a "Check Every Minute"-type macro, is there a way to trigger a Keyboard Maestro macro whenever that process is launched?
I assume not, but I'd be glad to be wrong.