Analytical transformed harmonic oscillator basis for three-body nuclei of astrophysical interest: Application to 6He