It varies by firm, but all consultants end up specialising at some point.
Bain lets you stay Generalist for the longest (that I Know of) until you are a few years into Manager (so 5-6 years since grad position)
Strategy& (in London at least) makes you specialise after 1 - 1.5 years.
Most firms are somewhere in between.
It's also worth noting that specialisation can occur on 2 dimensions:
- Industry: e.g. consumer products, TMT, Energy, etc.
- Capability: E.g. IT systems, Strategy, Cost Cutting, etc.