I have not been on too many codeshared flights, so my personal experience is not massive there, but you have two options:
- Look at the online departure board. Here's example for Heathrow:
Bunch of flights departing to basically two locations: Glasgow and Zagreb - most likely codeshares. In case of Glasgow we can be sure it's codeshare because it's departing from T5, and that terminal is used only by British Airways. Obviously just relying on time that flight departs might raise some false positives. There actually might be two flights at exactly the same time to the same location, but it's pretty unlikely.
- Check on Flightradar24 - when searching for codeshared flight it will actually tell you how it maps to code of airline that operates it. Then after actually searching for it, it will show you information for the operating airline.