Origin of the structural phase transition in single-crystal TaTe2