If the snippet is always called from the same page, I'd be tempted to use an unused resource field if there is one (e.g., introtext, longtitle, or description). You could update it in the snippet and display it with a simple tag like this one:
If there's no unused field, you could use a TV called transaction_number by directly updating the modTemplateVarResource object and display it with an uncached TV tag (note: this code won't work until the TV has an initial value for the resource).
$tvId = 12; // change to ID of the transaction_number TV
$docId = 14; // change to ID of the resource;
$tvr = $modx->getObject('modTemplateVarResource', array('tmplvarid' => $tvId, 'resourceid' => $docId));
$value = $tvr->get('value') + 1;
$trv->setValue(sprintf('%06d', $value));
$tvr->save();
If this will show on more than one page, I'd create a new System Setting, with a key of transaction_number, and use that (again, give it an initial value). The tag would be:
[[!++transaction_number]]
$setting = $modx->getObject('modSystemSetting', array('key' => 'transaction_number'));
$value = $setting->get('value') + 1;
$setting->set('value', sprintf('%06d', $value));
$setting->save();
The TV or the System Setting should be of type 'text'.