If the genome of this bacteria is already sequenced, you can do a homology search, such as blast. You just need to generate a file containing the genes involved in stachyose biosynthesis (according to http://www.metacyc.org/META/new-image?type=PATHWAY&object=PWY-5337 just three) and perform BLAST search