Given a set of points, find all collinear subsets
Here is a simple algorithm.  For each way to choose 2 points from $P$, find the line that goes through those two points and then find all other points from $P$ that are on the line.   If this yields at least 3 points, output it.  Continue until you've iterated over all possible ways to choose 2 different points rom $P$.

The running time will be at most cubic.  In particular, suppose there are $m$ points in the set $P$.  Then there are ${m \choose 2} = m(m-1)/2$ ways to choose two different points from $P$.  Thus, you'll do $\Theta(m^2)$ iterations.  Then you can find all other points on the line in at most $O(m)$ time, so the total running time is $O(m^3)$.

There are probably more efficient algorithms.  However, this might probably suffice for your needs.  Specifically, in your example, you'll have $m \le 5^4$.  Also, each iteration can be done faster than $O(m)$ time: given two points $p,q \in P$, you only have to check at most 3 other cells in the tic-tac-toe space.  So, in your situation, the running time is $\Theta(m^2)$, and $m^2 \approx 2^{18.6}$, so this should be pretty fast.