I wonder if we couldn't extend the transaction framework. At the moment it is highly focused on App::Document and App::DocumentObject which makes it impossible to work with Gui::Document and Gui::ViewProvider.

But what if we introduce a new type App::AbstractDocument and App::AbstractDocumentObject so that App::Document and Gui::Document inherit from App::AbstractDocument and App::DocumentObject and Gui::ViewProvider inherit from App::AbstractDocumentObject?

The transaction framework then can use App::AbstractDocument and App::AbstractDocumentObject.