I think it’s under the bonnet, under the windscreen scuttle but BMW don’t call it ‘user-serviceable’ so is likely beneath a plastic cover or panel. The older 1’er had it in the boot I think.
BMW has made battery access ridiculously complicated on the F40 M135i xDrive. Unlike the older models where it was easily accessible in the boot, this one is buried under the left-hand windscreen cowl, and removing it is an absolute pain.