Trial and error, cut all from your diet, then eat one at a time, I have problems with leafy greens, oranges and beetroot.
You may find it a rogue one or 2 causing problem.
Which fruit and veg ? and how much ? Most T2's on the forum are low carbing and "healthy eating" has a different meaning as when on LCHF as most fruit and root veg are off the menu or have to be strictly controlled. Controlling T2 using LCHF involes turning a lot of what has been pushed at us as healthy eating out the window.
Metformin has different effects on different people, it gives quite a lot of people "rapid intestinal transit" however with me it had the opposite effect. . Some people who are having a hard time on Metformin find getting their GP to prescribe the slow release version helps a lot but it is early days for you and our bodies adjust to the drug.
A good place to start eliminating is using the high FODMAPs foods. They cause fermentation and IBS-like symptoms in many people. It really is trial and error working out which ones are the problems for you.