Once you identify a start, count forward. Check if $x + 1$, $x + 2$, $x + 3$, and so on exist in the set. Stop when you find a gap.
For each start, this takes $O(k)$ time where $k$ is the length of the sequence. But each number is visited at most twice (once as a candidate start, once during counting), so total time is $O(n)$.
Track the maximum sequence length found. That is your answer.