Unfortunately NamedXContentRegistry.EMPTY doesn't work for parsing QueryBuilders without registering the built-in queries first, but they should be available through searchModule.getNamedXContents(). So to create the parser in the above example you can use
try (XContentParser parser = XContentFactory.xContent(XContentType.JSON)
.createParser(new NamedXContentRegistry(searchModule.getNamedXContents()), content)) {
searchSourceBuilder.parseXContent(new QueryParseContext(parser));
}