American Ironhorses were/are known for having some electrical problems with the ignition system. The ignitor is very common to fail after time. If you buy a set of spark checkers (ones that you plug into wires between spark plug and wire, with clear plastic and bulb inside) you can plug them in and ride the bike, when it starts to fail, look down and see if they are still firing like they should.
If it ends up being the ignitor, Daytona twin tec makes a replacement module for them....
Daytona Twin Tec LLC - TC88A Ignition for 2003-2004 Harley-Davidson
You can also spray your intake manifold for an intake leak. With bike warm and at idle, spray with brake/parts cleaner from right side of bike, onto intake manifold seal area (between manifold and head)
If idle changes at all, you have an intake seal leak.