It can start when Hermione defends Snape in front of others in a very passionate way that has undertones of more than just respect. Her words are so vehement that Snape starts to notice her in a different light, and she then builds on that with more flirtatious gestures and remarks.
Often it starts with Hermione showing an unexpected interest in Snape's area of expertise. For instance, she might ask him for extra help in potions with a bit of a twinkle in her eye and a flirty tone in her voice.