Classes of degenerate elliptic operators in Gelfand-Shilov spaces