Diagnose first THEN repair.
There is a HIGH probability that the original poster's problem relates to "water in fuel" for whatever reason, and/or ethanol phase separation which is potentially linked to "water in fuel".
It is NOT necessary to replace parts in order to fix this. If the bike continued running in some fashion and cleared up (which appears to be the case) ... no action is required. Simply keep riding. Be aware of the possibility of the occasional misfire or hesitation due to left-over water in the tank until it all gets purged out. If the bike is running ok then simply ride it until it is very low on fuel (low fuel light flashing) and fill up.
Gas line antifreeze can help to get water dispersed in the fuel.
I highly doubt if the real issue is a clogged fuel filter, because clogged fuel filters don't miraculously un-clog themselves. The symptoms would not have cleared up as described. The symptoms would have gotten progressively worse. Bike would have simply gotten slower... and slower ... and slower ... and rougher ... until it quit running and needed a tow. That's what happens when a fuel filter gets clogged.
I also doubt that the issue is the battery, because generally if the battery has enough power to crank and start the engine, the alternator will take over and maintain charging system voltage once the engine is running. (Do check that the battery terminals are secure, though. That costs nothing.)
If the issue is a plugged fuel tank vent, I already described how to diagnose it. To fix it, lift up the fuel tank and inspect the routing and condition of the vent hose. Pull it off the nipple underneath the tank and make sure it isn't blocked. When you set the tank down again, take care that the hose doesn't kink in the process of doing so. On that bike, "lift up the fuel tank" first requires removing: Passenger seat, rider's seat, left and right side fairings (because they plug into grommets that are part of the fuel tank - don't forget the screw underneath the headlight on each side, and the one facing inward near the exhaust pipe at front of engine), unbolt and release but don't fully remove the side fairings underneath the rider's seat (because they attach to the fuel tank), the little trim panel at the front of the fuel tank, which reveals the center bolt that holds the front of the fuel tank down. Sounds intimidating but it takes 10 minutes once you know how to do it.