So, basically, start roasting the onion first on low heat for a little before starting to put in all of the other stuff
Theoretically you could also do that with the red lentils, but that's a bit complicated when they're still dried, you could cook up the lentils first in a seperate pot and then roast them a bit in the original with the onions to have a bit more of a roasted flavour, dried lentils would work as well too though