There are probably a couple of ways to work up to straight legs. If you can only do a couple then I would do as many straight leg as you can and then finish the set with knee raises. You could also start doing the knee raises while holding a 5 or 10 lb dumbell (or other weight) between your feet until you are strong enough to do the straight leg.
Also, don’t forget that other ab exercises will also help you get to the goal of straight leg raises. So just work at getting an overall stronger core and the leg raises will come along with it.