Details: How is \Magento\Sales\Model\Order\Payment\Transaction\Builder::build() implemented and used?
\Magento\Sales\Model\Order\Payment\Transaction\Builder::build()
See also:
\Magento\Sales\Model\Order\Payment::setTransactionId()
\Magento\Sales\Model\Order\Invoice::setTransactionId()