One way could be through a time - travel or alternate - reality plot. Maybe Hermione discovers a way to go back in time and change Severus' fate. She sees his potential for good and they form a deep friendship that gradually develops into a relationship where they consider having a child together. This would focus on their mutual understanding and respect for each other's intelligence and abilities.
Perhaps there is a prophecy that only their combined magic can bring about a new era of peace in the wizarding world. To fulfill this prophecy, they need to have a child. Hermione, being very committed to the well - being of the wizarding community, and Severus, realizing he can have a new start, decide to come together. They start with a partnership based on the common goal, and as they work towards it, love blossoms and the idea of a baby becomes a part of their future plans.
In a magical accident, their minds could be linked. As they get to know each other better through this mental connection, they find out they have more in common than they thought. Hermione, being the empathetic person she is, helps Severus heal from his past traumas. This new - found closeness could lead to a relationship and the idea of having a baby as they build a future together in the wizarding world.