I’ve seen it done in Harry Potter I just don’t understand when its okay to do it, like can I say something like “John walked away from the house and was now walking along the road” or not? When is it acceptable?
Think of "now" as a thumbtack that refers to a specific moment. That moment can be in the past.
Jane had been a student. Now she was a programmer.
Jane looked up, drearily. Now, now, of all times, he was going to interrupt her?
Jane ran round the house. Now the car was gone. Where could it be?
In a past tense story, "now" means "at the moment in question," not at the "present."
It is acceptable when relating a sequence of actions or events.
Jake fed the chickens, then walked the rows of the tomato garden and pulled six new weeds that had sprouted, and now he was throwing a ball for the dog, Reggie. Reggie, panting and waiting for another throw, closed his mouth and turned his attention sharply toward the dirt road that led to the house. Jake turned, too. It was that green truck again. Curtis from the dry grocer, Mama's friend.
The whole thing is past tense, but some of it is more past than others. In the example, I don't want to spend a lot of time describing how Jake fed chickens or pulled weeds, those aren't important at all. I just want to indicate he did his chores and time went by. He didn't just step outside, throw a ball and hear a truck.
I could have said that, "He did a few chores and was playing with the dog, throwing a ball for the dog to fetch." But to me that sounds too vague, for readers I want them to see Jake doing those mundane chores without boring them to tears.
When you are telling a story in the past tense, there is still a "present" in the novel from the viewpoint of the characters, not the narrator. On a given page there is stuff they have a past, deeds done and things learned, and a future, deed to do and things to learn. That is the "Now" being referred to.
"Now" is used to return the reader to the present state of the character (from the character's point of view) after you the author have glossed over some time (from minutes to decades) by reciting a short history of that time.
If English if not your first language the usage of "now" is difficult to fully comprehend. It has many nuanced translations but is most often used to mean "in this moment". It is also used to emphasise a statement.
"Now Daddy didn't take too kindly his only daughter dating a black boy."
"They put the homeless kids in cages, now that ain't right."
Your sentence is acceptable.