A worldwide or faction-wide unit limit isn't really possible. The only thing you can do is check for a maximum number of certain units in garrisons (not very practical as the player can just keep them in the field) and a limit of one unit is possible because there's a I_UnitExists condition.
You can't watch units being built either because you can't check on lost units.

Of course you could issue a house rule and pop up an advisor reminding the player of it whenever he tries to recruit one of those units.