Calling esRDD in a transformation method causes Task not serializable

As I've mentioned in another thread, you are being quite cryptic in your questions so it's hard to understand what the issue is.

Task not serializable it's a common issue in Spark cause by the fact that you are passing around code which is not serializable. And yes, nesting an RDD of any kind qualify as such - take a look into the Spark docs, it's easy to get around it by keeping the data point outside your code and trying to leverage as much as possible the RDD functions.
Note that an RDD is a distributed collection in the end - it acts like one but it's actually a proxy to a distributed job.