Hilchos Lashon Hara chapter 4, section 6
It seems to me also that if a person tends to repeat their foolishness, and their rav (teacher) can influence them, it is perhaps allowed to tell their rav – even if the matter might then become known to others through the rav.
But even if two people saw the sin, it is allowed to tell only the town's judges and no one else. Since we saw the person sin only once, perhaps they did teshuva (repented). So they are still counted as "your fellow."