Here’s a sample project.
It has three components: a layer we need to find the top of, a null that will represent the top of that shape, and the graphic elements we parent to the null.
You have to initially position the null inside the target shape; then an expression on the Y position uses a binary search to somewhat-efficiently sample the comp raster column above the null image until it zeroes in on the transition point between transparent and non-transparent alpha (aka, the top edge of the shape).
Here’s a little GIF of the results in action, too, on a couple different shapes.