Hi, I had gone through your question and understand your concerns.
It is normal for two and half months baby to pass gas . But it can make baby uncomfortable , best remedy is proper burping of baby . You have not mentioned is baby breast fed or bottle fed, If bottle fed, you can check opening of nipple , it should be neither too large ( risk of aspiration ) or small ( taking more gas than milk).
Try be feed baby in sitting ( mother ) or reclining position with head on upper side.
No milk of magnesium
is not recommended for such a small baby.
You can try caspa drops , they are safe , but best is proper burping and position .
Hope this answers your question. If you have additional questions then please do not hesitate in writing to us.
Wishing your child good health.