As I said, this was a long time ago. I used to have ILR (which lapsed, so I'm having to go all through this again). The number was on the letter from the Home Office, and they had written the same number by hand inside the back cover of the passport.
As I recall, though, when I registered for the KOL test, the form said "Home Office Reference Number (if known)".
I posted a question about this number myself in mid-November, and one person even said they had been given several different numbers. I just gave what I had from several years back. Someone else with better or more up-to-date information can chip in, but it doesn't seem to have been an issue.