Accelerating the convergence of exact diagonalization with the transcorrelated method: Quantum gas in one dimension with contact interactions