A radially resolved magnetic field threading the disk of TW Hya