ok... hmmm...
You can create control points for a line but you cannot animate the control points in FCPX. If you're okay with that, then here are the basics:
Create a new top level group. Name it OSCs.
In the Inspector, select the group and in the Group tab of the inspector, select Fixed Resolution. (It should already be set to 2D - if not - set 2D)
In the Properties > Timing pane, set the length (Duration) of the group to at least as long as your project. (this step is not important in Motion but absolutely necessary for FCPX!)
With the new group selected, add the filters you will use as control points. In general, every starts with Filters > Distortion > Poke. You will need two of them. For each Poke filter, select Publish OSC in the inspector. (I recommend renaming each filter - startOSC, endOSC for example.)
Create another new group.
Go into the Library > Content and search for Crosshair -- there's three of them, use Crosshair-Minute (they're the smallest ones.) Add two of them. (It's not necessary that they're in their own group -- just more convenient.) Rename the crosshairs: keeping with the OSCs, I recommend start and end, for example.
Draw a Line.
To the shape (line), add two Behaviors > Shape > Track Points.
Rename the Track Points: Start and End.
In the Behaviors inspector for the Track Points, drag the start Crosshair image into the Source well of the Start track points and the end Crosshair image into the End Track Points. The behavior parameters will change and you'll see a bunch of new stuff. Down at the bottom, you'll see Track 1 and Track 2 — leave one checked for one of the behaviors and the other one checked for the second behavior (that's 1 track 1 and 1 track 2.) You'll also see that the Transform is set to Mimic Source. What you need to do is click the reset button on the Checked Track of each behavior and THEN change the Transform to Attach to Source. Once you do that, the line ends will snap to crosshair images (use Properties Transform X to move the crosshairs apart temporarily.)
Next step:
Select the start crosshair and in the Inspector > Properties, dial down the Position to reveal the XYZ parameters. Right click on the X and select Add Parameter Behavior > Link. Repeat this step for the Y parameter (you cannot link Position.All for this step.)
In the Behaviors inspector, for the start crosshair:
For the Source Object, drag the OSCs group into the well.
for the X parameter
For the Source Parameter, set Filters.startOSC.Center.X for the Position.X
and set Filters.startOSC.Center.Y for the Position.Y
You will notice the line end disappear off the screen. This is normal. To correct this, at the bottom of each behavior, set the X (or Y) offset to -0.5.
Repeat for the end crosshair.
You can turn off the crosshairs (uncheck the layers.)
To test your OSCs, select *both* startOSC and endOSC (command select each layer) -- both Poke OSCs will appear and you can drag them around the canvas. The line should follow as you would expect if you've set everything up correctly.
Publish the template.
A couple of explanations:
2D fixed resolution for the OSC group: Groups in Motion that are not fixed resolution can dynamically change their boundaries. There are no fixed points of reference for Motion to calulate. If you forget to set Fixed Resolution, you can repair the condition by setting the Fixed Resolution option and then go into the Filters pane and reset the Center parameters for each Poke OSC.
Offsets of -0.5: All resolutions in the Canvas are calculated by the resolution of the X and Y dimensions of the project times the fractional position of objects (from 0.0 on the left side for X and on the bottom for Y — to 1.0 on the right side for X and on the top for Y.) The center of the canvas is 0, 0 in pixels of whatever the resolution is. To adjust the fractional position used by the OSCs (and others) to the center pixel, the value needs to be moved by 1/2 of that distance.
Clear as mud? Once you've done it a few times, it will all become second nature.
One more thing: you can publish curves... complex ones. But they have to be B-spline (you track all the points in a similar manner outlined above) and not Bezier. There's no way to control the handles for bezier curves.