Method for the primary mass composition study of ultra-high-energy cosmic rays with the Telescope Array surface detector