alternator replacement ? on 1998 Mercury Mystique

my battery light goes on when I go into overdrive, then when it shifts out of overdrive, the light goes out. Also my headlights dim and then brighten.

Asked by for the 1998 Mercury Mystique
check the charging system battery & alternator