There's no need for you to do anything to associate the transaction and stream, because the txid of the transaction which created the stream can be used directly as a parameter in all APIs relating to that stream, as an alternative to the name (or streamref). So your best solution is to not pass any name at all, in which case it will be an unnamed stream that can be referenced by its creation txid.
(In any event, you could never set the stream name to the creation txid because the txid depends on the content of the transaction, and the stream name is part of that content, so you have a dependency loop.)