Do you actually know it was a mistake though? As you don't know whether it has been answered correctly or not, I wouldn't use the words 'mistake' or 'error' at all. Instead, you are simply clarifying why you answered the question the way you did.
Ultimately, though, it doesn't really matter, as they will be able to see from the marriage/divorce paperwork that it was the UK sponsor and not the applicant who was previously married.
So, I would just put something like:
To Whom It May Concern,
I am writing to clarify one of the answers given in my online SET(M) application for ILR.
For the question, ‘Have you previously been married or in a civil partnership?’, I have entered the details of my UK partner's previous marriage, as I was unsure whether the question was asking about myself or my UK partner. To clarify, I have never been previously married, but my partner has, and we are including the relevant paperwork as evidence of this.
Yours Faithfully,
Her Name