As you know if you sauté onions they'll start to get sweeter the more they stay in the frying pan.
So is there a trick to avoids this sweetening, maybe keep more of the onion taste?
From The Times of India:
Add a hint of tanginess:
Adding lime juice can to your dish can balance out the sweetness. In case, you don't want too much of tanginess in the dish you can also add vinegar white wine vinegar, red wine vinegar, balsamic vinegar.
When you cut into Allium like onions or garlic a chemical reaction occurs which gives you that fresh onion smell/flavor. As time goes by that reaction will continue, unless it's stopped by heat or acid. Basically if you wait, start with 15-20 minutes, after chopping your onions you can maximize the pungency. Which I think could help in masking the sweeter taste.