Matching ABACABA-type patterns
J, 63 58 53 52 51 47 bytes
_1}.1#.a:~:[:([#~[e.&amp;,(],,)&amp;.&gt;/)^:a:~@;&lt;@(&lt;\)\.

Try it online!
-2 bytes thanks to Bubbler
-3 bytes thanks to FrownyFrog for golfier way to create all substrings of a string.
how
We'll use MOM as our example:

[:...;&lt;@(&lt;\)\. All substrings of the input, boxed.
┌─┬─┬─┬──┬──┬───┐
│M│O│M│MO│OM│MOM│
└─┴─┴─┴──┴──┴───┘


(...)^:a:~ Using the substrings as both the left and right args ~,
apply the verb in parens until a fixed point, keeping track of each iteration's
results ^:a:.

(...(],,)&amp;.&gt;/) To create the next &quot;level&quot; of candidates, create all possible
combinations that look like &lt;level_n&gt;&lt;orig substring&gt;&lt;level_n&gt; where
level_n is any element from the current level, and &lt;orig substring&gt; is
one of the original input substrings (level 0).  Then the 1st level looks like:
┌─────┬─────┬─────┬───────┬───────┬─────────┐
│MMM  │OMO  │MMM  │MOMMO  │OMMOM  │MOMMMOM  │
├─────┼─────┼─────┼───────┼───────┼─────────┤
│MOM  │OOO  │MOM  │MOOMO  │OMOOM  │MOMOMOM  │
├─────┼─────┼─────┼───────┼───────┼─────────┤
│MMM  │OMO  │MMM  │MOMMO  │OMMOM  │MOMMMOM  │
├─────┼─────┼─────┼───────┼───────┼─────────┤
│MMOM │OMOO │MMOM │MOMOMO │OMMOOM │MOMMOMOM │
├─────┼─────┼─────┼───────┼───────┼─────────┤
│MOMM │OOMO │MOMM │MOOMMO │OMOMOM │MOMOMMOM │
├─────┼─────┼─────┼───────┼───────┼─────────┤
│MMOMM│OMOMO│MMOMM│MOMOMMO│OMMOMOM│MOMMOMMOM│
└─────┴─────┴─────┴───────┴───────┴─────────┘


[#~[e.&amp;,... Check if each original substring is an element of this candidate
list [e.&amp;,, and use that to filter the original substrings [#~.  In the above
example, only MOM passes.

After the above process iterates to its fixed point (no more matches), the result
is:
┌───┬─┬─┬──┬──┬───┐
│M  │O│M│MO│OM│MOM│
├───┼─┼─┼──┼──┼───┤
│MOM│ │ │  │  │   │
├───┼─┼─┼──┼──┼───┤
│   │ │ │  │  │   │
└───┴─┴─┴──┴──┴───┘


a:~: Since we don't want to count empty boxes, we perform an elementwise
test for &quot;not equal to the empty box a:&quot;, giving us a 0-1 matrix:
1 1 1 1 1 1
1 0 0 0 0 0
0 0 0 0 0 0


1#. Sum rows:
6 1 0


_1}. And kill the last element:
6 1