A melting-like process and the local structures during the anatase-to-rutile transition