So its a Nematomorpha or Gordiacea, common name is horsehair worm. Horsehair worms are parasites on insects especially grasshoppers, crickets, and beetles. Hopefully there are a lot of them out there and they'll kill off the lily beetles.