Detect a tab change in the N panel in Python

Hi!

Is that possible to detect an active tab change in the N panel in Python? I mean this panel:
image

I would like to detect that for example the user has switched from the Tool tab to the View tab - only that the tab was changed, the info which exactly tab was selected is not needed.

It looks like it may be possible using the msgbus system but I couldn’t figure it out what parameters should be used in the subscribe function to detect such an event.