How to tell the CubeMX an LSM303AH is connected to an I2C
..
..
This is essentially the same question you asked here.
CubeMX only cares about the configuration of the I2C port and doesn't care which sensor you connect there, because that is programmed later in the application program (typically in main.c).
As mentioned by @Imen DAHMEN you can find examples for I2C in the firmware repository. Drivers and examples for sensors can be found in the Github repository already mentioned by @Community memberurer.
Regards
/Peter
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.