First, the section with the desirable gene must be identified. Assuming that has already happened, the section of DNA must be excised from the original genome using restriction enzymes, which recognize certain DNA sequences and snip DNA at those sites. DNA ligase is used to "glue" these ends back together. The DNA is inserted into a plasmid (also with restriction enzymes), which would usually contain antibiotic-resistance genes (so they survive in an environment containing the antibiotic, which would also help show if the bacteria have been successfully transformed).
Then comes the actual transformation process. The bacteria to be transformed are mixed with calcium chloride (which causes the bacteria to be more receptive to the plasmids) and then mixed with the plasmids. The bacterial cells are subjected to a heat shock (the solution is heated and rapidly cooled, e.g. by placing the mixture in a hot water bath and quickly transferred to ice) so they will take up the plasmid (since the temperature change makes the membrane more permeable). The bacteria are placed on a growth medium containing the antibiotic they're resistant to. Only those successfully transformed would survive.
The submarine will most likely find data that shows the highest pressure data and the lowest temperature data (unless of course it's near a hydrothermal vent). This is because due to the depth there's a lot more water above it putting a lot of pressure on the sub, and very little sunlight to heat up the water.