How do I create an external transformer class when using the ElementApi plugin?
You're getting a whitescreen because you've got some PHP syntax errors in both files. Craft isn't reporting them because those config files get loaded before Craft has had a chance to bootstrap.  The underlying errors should be recorded in your web server's error logs depending on your default server configuration.

Try these:

elementapi.php

&lt;?php
namespace Craft;

require_once craft()-&gt;path-&gt;getConfigPath().'transformers/EntryInfoTransformer.php';

return [
    'endpoints' =&gt; [
        'api/articles' =&gt; function() {
            return [
                'criteria'        =&gt; [
                    'section' =&gt; 'blog',
                    'order'   =&gt; 'postDate desc',
                ],
                'elementsPerPage' =&gt; 5,
                'elementType'     =&gt; 'Entry',
                'transformer'     =&gt; new EntryInfoTransformer(),
            ];
        },
    ]
];


EntryInfoTransformer.php

&lt;?php
namespace Craft;

require craft()-&gt;path-&gt;getPluginsPath().'elementapi/vendor/autoload.php';

use League\Fractal\TransformerAbstract;

class EntryInfoTransformer extends TransformerAbstract
{
    public function transform(EntryModel $entry){
        return [
            'id' =&gt; $entry-&gt;id,
        ];
    }
}