There isn't really a good way of doing this. But there is a way of doing it.
With the stroke on its own layer, from the align pallet centre the layer to the composition horizontally and vertically.
Now copy the layer's current position value. Then right-click the position property and choose reset,
Go the stroke's anchor point value (not the layer anchor point but the one inside Contents>shape1>Transform: Shape1.
Paste the original position value there, then click on the individual property values and subtract the value there from half the size of the comp (in other words whatever the position property is now). So if the comp is 1920×1080 and the copied value was [999,123] you'd type 960 - 999 in the x channel and 540 - 123 in the y channel.