Since the number of words per line changes based on screen size, font size, margin size etc. the best way I have found is to just use the pseudo-element :first-line. That works really well
on devices that support it...

. The ePub spec says: first-line and :first-letter are required to be supported but that doesn't mean they all do...
If you are making the book for public consumption you should stick with wrapping a span around the first few words for an italic or small caps effect...or easier still just highlight the first few words and click the all caps button to manually change them to caps.