Charlize Theron's past family tragedy helped her prepare for new film