I made a vector graphic in Inkscape, including layers and sub-layers for further use in Processing. I named all the layers in the UI, and realized that the final SVG only creates an inkscape:label attribute with that name, but id remains generic:
<svg:g id="layer1" inkscape:label="My custom label">
I know I can manually edit the labels in the XML editor, but is there a setting somewhere to automatically use the layer name as id?

I don't know about a setting to automatically use the layer name as id. But why not do it the other way round: if you remove the
inkscape:labelattribute, then the layer name automatically becomes theidof thesvg:gin the inkscape UI. The attributeinkscape:groupmode=layeris enough to make thesvg:ga layer element.