extra.less is handled specifically, so there isn't any way to hook into that. Even relying on extra.less being last isn't 100% guaranteed to be correct due to situations where we may dynamically load CSS. Given that case, CSS order (across files) is roughly non-deterministic, though it won't come up often.
We would generally assume that a.less and b.less are independent. If there's a situation where they're not, I think I'd likely recommend that a.less simply includes the contents of b.less automatically, either by dropping b.less entirely or putting an include in a.less. Based on your description, that sound like it might be the best solution here and there are a couple approaches to organizing this, if code organization is a concern that has stopped you from going down this route. Given that we're talking in generic terms, it's hard to be specific, so if you want to give me a more concrete example that might help (you can send it privately if you prefer).