+1 to the probiotics suggestion. When I became vegan I noticed that I was getting a lot of bloating/gas.I assumed it was due to gut microbiome not being optimal for the much higher fiber and carbohydrate diet. What I did to treat it with pretty good success was a few fold.
1) Start brewing your own kombucha or other fermented foods. I'm vegan so yogurt was out.
2) Chew on tea tree oil toothpicks for about a week. The package likely warns against overuse causing diarrhea, this is because of tea tree oil's strong antimicrobial activity.
3) While you're letting the tea tree oil do work on your gut microbiome, you want to increase your fiber intake, be it through foods or supplements. I'm talking 40g+ of fiber a day. (At this point I also added drinking a bentonite clay mix before bed and upon waking. You will literally **** bricks so be warned.)
4) After this tea tree oil cleanse, continue to eat high fiber diet and make sure you are getting a serving of fermented food every day.
This is what worked for me to reduce the bloating and gas. Took care of it in about a week. In an ideal world you could get a fecal transplant from someone who already eats your new diet to avoid the side effects of drastically changing your diet but I am not sure how many people would want to have a fecal transplant.