Method 1 : Applying the ocean modifier first
In edit mode, select your whole mesh, create a Vertex Group and assign a weight of 1 to everything.
Create a plane which you will hide later that is at the same height as your beach plane. Create another plane with the same width as your ocean mesh.
In your ocean mesh, add a Vertex Weight Proximity modifier, set the vertex group to the one you just created, set the target object to the strip, set the proximity mode to geometry and SHIFT - Click and drag on Vertex, Edge, and Face to select everything. Set the falloff accordingly to your prefered method of interpolation.
Set the Highest to 0m and increase the Lowest value. You might have to come back after the next step to increase or decrease it to get the desired effect.
Now add a shrinkwrap modifier, set it to project along negative and positive Z on the target plane and set the vertex group.
Now hide the two planes. Here's the result with and without the shrinkwrap :
Here's how to tweak the settings :
Method 2 : I found a workaround to keep the ocean modifier alive. It is kind of a hack. But I don't really understand why we can't use vertex groups in a Vertex Weight Proximity if they have not first been initialized on the mesh with a weight of 1. Seems like an oversight unless I'm missing something.
So, before adding the Proximity and Shrinkwrap modifier, you need to add 3 modifiers : Ocean, Solidify, and Mask. The actual settings of the ocean are irrelevant here.
The idea is to take advantage of the fact that since Version 2.83 you can set a custom vertex group for the shell resulting from a solidify modifier. We are then masking all the vertices that are not part of that shell, since they will not get affected by the shrinkwrap.
Method 3 :
Just thought of another method with a simple lattice. Keep your ocean modifier and add a lattice. Scale it in Object mode so that it is slightly larger than your ocean mesh.
Go into the lattice settings and reduce the V to 1 and increase the U to something like 30. You should have something like this for now :
Go into edit mode with the Lattice selected, activate proportional editing with O or click there :
Select the top and bottom points of the last 3 or 4 columns of your lattice, and scale along Z by 0 (S - 0 - 0). Scroll the mouse wheel a few times to get this kind of shape :
Go out of edit mode, select the Ocean Mesh, and add a Lattice modifier. Set the lattice object to the one you just created. You might have to input a value > 1.00 to get a good smoothing (I don't know why...) so that the end of the ocean is almost perfectly flat.