Question on transactions

In software I’m working on we load, eventually modify in memory, and save multiple documents, for now without using any transaction. All this works all fine, but for some specific cases we want to save some documents in mode either all of them or none of them if some issue happens, hence using a transaction.
The process of saving documents to MonogDB happens in some specific internal function that deals with this process and we would to keep change to add transaction support as small as possible.
Is it possible to keep current logic that loads, modifies documents as it is, without dealing with any tx API nor descriptor data and keep transaction handling solely in internal function that deals with saving documents ?
Hope it makes sense,
Thanks for any hint on this