My undershirts have turned yellow in the armpit area without the benefit of aluminum antiperspirants. I assumed the stains were from carbonaceous exudants from my pores - or the biogenic products of bacterial life on my skin.
So I bleached the undershirts, soaked them in a diluted bleach (sodium hypochlorite) solution (about 1 in 10, I think). BIG improvement. Not perfect, but very good. One of the side effects was that the undershirts turned blue in the bleach because of the whiteners in the surfactant used to wash them. But that faded as the bleach continued to oxidize the stains.
You can go overboard and use more concentrated bleach: this will perk up the entire undershirt! Interestingly, it seemed to not only clean the underarm stains, but also attack/weaken the fabric there, so the stains went away, but small holes started to appear there, which grew larger and larger until the undershirts became nice dust cloths.
Next time, I think I will try an oxygen laundry bleach, even if it takes longer. Or H2O2.
Addendum: the supposition that the brown deposits in the armpit area are due to aluminum compounds is widespread. Even undershirt makers suggest it - but of course, take no blame for providing the substrate that shows the stain. One manufacturer (https://thompsontee.com/blog/the-science-behind-your-pit-stains-and-what-to-do-about-it/) even has a link to fixing it. What do they suggest? Change your antiperspirant; take proper care of your clothing; wear a sweatproof undershirt. (They offer the best sweatproof undershirt: 20% off!) But how to get rid of armpit stains?
#1. Vinegar, baking soda and HYDROGEN PEROXIDE.
#2. OxiClean or Raise Stain Remover (mixed reviews)
Nivea makes deodorants and has a site that recommends ways to remove armpit stains: try an acid. For example: #1: HYDROGEN PEROXIDE #2. Baking soda (?) #3.White vinegar #4.Lemon juice. https://www.nivea.com.au/advice/skin/removing-deodorant-sweat-stains
The desire to use environmentally safe washing agents in certainly admirable, but when you have to do a job, it is quicker to use the powerful tool. Of course, there is a learning curve. I love bleach because its activity is so adjustable and controllable - from an additive at low concentration to eradicate gingivitis by waterpicking to clothes cleaning to mildew removal from house siding, and probably a million more uses.
But I suppose hydrogen peroxide will be adequate. Or OxiClean.