Jimmy told her.
Jimmy observed the scam on his first visit...
In the scene where Jimmy first visits, he observes Mrs. Kettleman handing a Kettleman check (not an IRS check) to an elderly man, and the man carries it right past Jimmy, who opens the door for the man. He is holding the check in his hand, out in plain view for Jimmy and the audience to see.
I have worked part time for a tax preparer. Tax preparers are supposed to take payment ahead of time (a flat fee, regardless of refund) and file the person's taxes so that the IRS mails their check directly to the customer's home address. Filing returns from their business address so that they get the checks and then giving the customers a company check for their refund is an obvious scam. The only checks made out by the tax preparer I worked for that I ever saw were my pay checks.
...then Jimmy told Kim about it, and told her he planned to use both the threat of the IRS and a cash payment (the carrot and the stick) to keep them from reporting to Hamlin that Jimmy was spreading drug rumors about him.
Jimmy needed to prevent the Kettlemans from telling Hamlin that he was slandering him. He developed a two-part plan of positive and negative incentive--the "carrot and the stick" as the old adage goes (and also the title of the episode). The carrot was a payoff. The stick was the threat to report them to the IRS.
We know Jimmy told Kim, because later, when the Kettlemans call Jimmy to complain that he lied to them about their chances with a claim against HHM, Jimmy gets ready to go appease them. He starts taking stacks of money to pay them off and Kim says: "You're going to use the stick, right?" (0:46:05). The "stick" is the threat of reporting them to the IRS (the negative incentive), so the fact that she references this means he told her about the scam. He is taking money as "the carrot," or the positive incentive.
Kim then tagged along and made sure to use the info to threaten the Kettlemans so she could put a stop to their scamming poor people.
Thinking Jimmy is just going to pay them off, she decides then and there to tag along (Jimmy was originally going alone) so she can ensure they threaten the Kettleman's with an IRS investigation -- "the stick."
When they arrive at the Kettleman's trailer, an elderly woman is coming out carrying another Kettleman check. The camera focuses in on the check in her hand and there is a lingering shot of Kim watching her. This shows Kim seeing evidence of the scam for herself. It also underscores that she is appalled by the Kettlemans taking advantage of poor, elderly people like that and is determined to stop them.
Before Jimmy can hand over the money (the carrot), Kim interrupts and calls the IRS (the stick). Then she leaves. Jimmy was probably feeling a little sorry for the Kettlemans, especially the husband who seems like a nice guy. Kim guessed that Jimmy gave them the "carrot" too after she left the office and his reaction indicates that he did. Jimmy has more of a soft spot and tolerance for scammers because he is/was one.
Analysis: Kim makes the smart play. If Jimmy had just paid them cash and not raised the issue of their scam, the Kettlemans might have taken the money and reported to Hamlin anyway. Mrs. Kettleman especially is very vindictive and had a grudge against Jimmy for making them give back the embezzled money in Season 1. She needed some threat hanging over her head to ensure she did not take the money and tell Hamlin anyway.