Writings reveal deep gender identity turmoil and regret before Minneapolis massacre.