Weight changes in perimenopause
Noticing a change on the scale during a year that is already full of other changes is frustrating. Looking into it without guessing at a cause starts with a record.
Look for the cause with a clinician
Look into it with a record and a clinician rather than a guess at the cause. The federal drug regulator's menopause page for consumers and a government women's health office's menopause guide are the places to read about the transition itself. For the weight side, a national library has a page on obesity, and a national health institute keeps a hub on weight management.
A few weeks of tracking

A record is more useful to bring to a visit than a theory. For a few weeks, track your weight on the same day each week, your sleep, a rough picture of meals, and any new medicines or supplements. Note the dates your cycle changed too.
Bring that record to an appointment, since a clinician can look at your whole picture and tell you which pieces matter.
Booking the visit
Read the sources above, then book a visit with a licensed clinician. Ask which tests, if any, make sense, what a realistic plan would be for your schedule, and when to follow up. Do not start or stop a medicine on your own because of something you read here.
What a record can and cannot explain
Building a record for a visit gives a clinician something to work from and does not explain the change in your weight. A clinician is the right person to help find the reason.