How should I use GDAL to perform a transformation?

Actually, you will want gdalwarp, not gdaltransform. There are lots of examples out there.

For example,

gdalwarp -t_srs 'EPSG:4326' input.tif output.tif

EPSG:9802 is an operation (map projection) method, not a complete coordinate reference system definition. There's not enough information for gdaltransform to work. Can you identify the data's current coordinate reference system? You can do a search by area at the online EPSG registry or download a Microsoft Access database version, EPSG Geodetic Parameter Dataset.

The example that you referenced is:

gdaltransform -s_srs EPSG:28992 -t_srs EPSG:31370

177502 311865

Produces the following output in meters in the "Belge 1972 / Belgian Lambert 72" projection:

244510.77404604 166154.532871342 -1046.79270555763

In this case, the input is EPSG:28992, "Amersfoort / RD New", not EPSG:9802.