See also:
\Magento\Sales\Model\Order\Payment::setTransactionId()
\Magento\Sales\Model\Order\Invoice::setTransactionId()