In Harry Potter and the Sorcerer's Stone, freedom is represented as Harry being away from the terrible life he has lived at 4 Privet Drive with the Dursley family. Being among wizards and living in the wizarding world means a return to Harry's true heritage, which is also a significant aspect of freedom. Freedom also means not being tormented and bullied by his cousin and having friendships for the first time in his life.
In Tom's Midnight Garden, freedom means escaping from loneliness and homesickness at night by going into the midnight garden, where he gets to spend time with Hatty, who becomes his friend.
In Roll of Thunder, Hear My Cry, freedom would mean being free from racism, oppression and the violent thugs or "night riders" who are destroying the land and livelihood of black landowners. It would mean being free from fear of injury or death based on the color of your skin.
If you are writing an essay that compares the notion of freedom in these three great books, I would point out that Harry Potter and the Sorcerer's Stone and Tom's Midnight Garden offer a view of freedom that has remarkable similarities. Both involve escaping a difficult home environment and discovering friendship and acceptance in a new environment.