Shemiras Halashon Halachos

Hilchos Lashon Hara chapter 4, section 5

But if he sees that the sin was committed by a person who is among those foolish people who are scoffers and cynics, people who hate rebuke, as Shelomo Hamelech teaches in Mishle: "Don't try to rebuke a scoffer because he might come to hate you", and most assuredly he would not accept rebuke, and can repeat his sin again. Therefore, it would be appropriate to disclose his action to the authorities of the city who would then chastise him because of his sin and prevent him from committing the sin in the future. It also would be appropriate to disclose his actions to the relatives of the sinner since they can influence on him. Note the sole motivation of the one who is reporting this person's actions must be for the sake of Heaven, and not for the hatred of the sinner. Also, the judicial authorities must chastise this person discretely and not shame him publicly.

Hilchos Lashon Hara chapter 4, section 6

It further appears that a person who will likely repeat the same foolish mistake, if his rabbi is an authoritative person whose words of rebuke will be accepted by the transgressor, it is permitted to disclose his action to him, even if that rabbi is not particularly discrete and the disclosure will become public knowledge. Even if two witnesses watched this person commits a sin, the disclosure can only be made to the city's judicial authorities and to no one else. Because he has been seen committed a sin only once, and maybe regretted his sin and did Teshuvah, therefore this person is still categorized as "your fellow Jew".