Lie algebraic similarity transformations: improving wavefunctions for weak and strong correlations