If it's only for training, the easiest way to make this serializeable is to make it extend MemoryStore and then add the following to MemoryStore.scala: 

Either:

    kryos.put(classOf[GlobalCounter].getSimpleName,{
      val kryo=new Kryo()
      kryo.setRegistrationRequired(true)
      kryo.register(classOf[GlobalCounter], new JavaSerializer())
      kryo
    }

or:

    kryos.put(classOf[GlobalCounter].getSimpleName,{
      val kryo=new Kryo()
      kryo.setRegistrationRequired(false)

      kryo 
    }

For the final output of the model, this should be more optimized, however. MemoryContextStore, for example, has a custom serialization to make it space efficient and fast: https://github.com/forrestgithub/dbpedia-spotlight/blob/034bcc92a398df20b353b2b291c4d125493801fc/core/src/main/scala/org/dbpedia/spotlight/db/memory/MemoryContextStore.scala#L59