I wouldn't change the alternator unless you know it's bad.
Take a battery measurement with the engine & accessories off (should be about 12.5 VDC). Take another battery reading with just the engine running (should be about 14.5 VDC), and then take one when you experience the dimming (should still be above 14 VDC).