A private investigator is usually not part of law enforcement and they legally do not have to identify themselves if they're caught spying on you.
But the private investigator really should identify themselves as a private investigator if they are caught spying on you.
However some private investigators may be part of law enforcement or may be hired by law enforcement to carry out an investigation and then those people should be required to identify themselves to you if caught.
Although they may not and usually don't have to identify themselves.