There are several ways to do this
- The easiest way would be to just create a RenderTarget. With this you have access to the new multi-pass rendering thing from withing the material editor and blueprints (as well as c++)
- The next way would be to actually write a UTexture2D bit by bit and pass it to whereever you need it. You can read up on how to do that here
- Another way would be to implement your own texture asset type. This way you can write it however you want and can just reference it using the editor like you would with any other texture. You can look into how Paper2D and other asset importer handle this to get a grip on it. You probably need to do some custom work if you want to hook it up with things that expect a UTexture2D.