One possible plotline could be that Lockhart attempts to use Harry for some self - promoting stunt that goes horribly wrong, and Severus steps in to rescue Harry from the immediate danger. For example, Lockhart might try to make Harry participate in a dangerous magic display for his own glory, but Severus, seeing the real danger, intervenes.
One popular 'Severus saves Harry from Lockhart' fanfic might be found on platforms like Archive of Our Own. You can search using those exact keywords in the search bar on the site to find relevant stories.
One motivation could be Snape's sense of duty as a teacher. Despite his dislike for Harry in some ways, he still has an obligation to protect the students. So, when he sees Lockhart endangering Harry, he steps in.
Another possibility is that Snape uses his position as a teacher. He might threaten Lockhart with the consequences of harming a student. Given Snape's intimidating presence and his own power within the school, Lockhart would be afraid to cross him. Snape could also call for other teachers to help, making it clear that he won't let Lockhart get away with any harm to Harry.
Severus might start off as just fulfilling a sense of duty. He has always been a complex character. But as he saves Harry from the Dursleys, he begins to see Harry in a new light. He realizes that Harry is not just James Potter's son but an individual with his own struggles. This could lead to him becoming more empathetic towards Harry, gradually shedding some of his cold exterior.
Perhaps in this fanfic, Severus doesn't just save Harry physically from the Dursleys. He also saves Harry from the emotional and psychological damage that the Dursleys have been inflicting on him. Severus, having his own traumatic past, might be able to relate to Harry on a deeper level and starts to mentor him in ways that Dumbledore never could. This could lead to a completely different Harry, more confident and less impulsive.
Severus might be developed as a more complex and empathetic character. By saving Hermione from Ron, he shows a side of himself that is protective and caring, which is different from his usual cold exterior. This could be a turning point in how the other characters view him.
In the fan fiction, Severus could start to develop a sense of responsibility towards Harry. At first, he may have saved Harry out of a sense of duty to Lily Potter, but as time goes on, he realizes that Harry has his own worth. This could make him more open to forming a bond with Harry, which is a huge change for his character who has been so closed - off for so long. He may also start to question some of his long - held beliefs about the Gryffindors, especially as he sees Harry's courage in the face of his difficult upbringing at the Dursleys.
He might use his skills in Legilimency. By probing the minds of Voldemort's followers or looking into the general 'aura' of the area where he suspects Harry to be. This way, he can get a sense of Harry's location even if it's well - hidden.
One great fanfiction with this theme is 'A Different Kind of Family' where Severus discovers Harry's abuse and takes him under his wing. It shows Severus's complex character evolving as he protects Harry.